package com.liushao;

import com.liushao.dao.UserDao;
import com.liushao.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @program: untitled
 * @ClassName TestDemo
 * @description:
 * @author: 刘庆东
 * @create: 2024−11-28 09:19
 * @Version 1.0
 **/

public class TestDemo {

    @Test
    public void test1(){
        //解析spring配置文件
        ApplicationContext ac =
                new ClassPathXmlApplicationContext("applicationContext1.xml");
          //获取对象
       UserService userService = ac.getBean("userService", UserService.class);

        userService.show();

       /* UserDao userDao = ac.getBean("userDao", UserDao.class);

        userDao.haha();*/

    }
}
